var orderMenuList = getOrderMenuList(),
	navIndex = getValueByParam('index'),
	doms = {
		list: null
	};

$(() => {
	initHeaderNav();
	initDoms();
	loadData();
})

initDoms = () => {
	doms.list = document.getElementById('list');
	document.getElementById('loading_layout').addEventListener('click', e => {
		loadData();
	})
}

initHeaderNav = () => {
	const tabSlider = new TabSlider({
		container: '#tab_container',
		nav: '#tag_list',
		content: '#tab_content',
		data: orderMenuList,
		currentIndex: parseInt(navIndex),
		onChange: index => {
			navIndex = index;
			loadData();
		}
	});
}

loadData = async () => {
	setLoadingState(0);
	$("#list").html('');
	let res = await queryOrderList({
		type: navIndex
	});
	setLoadingState(1);
	if (res.code == 200) {
		setList(res.data);
	} else {
		setLoadingState(2);
	}
}

setList = mlist => {
	$(`#list`).html('');
	if (ArrayEmpty(mlist)) {
		setLoadingState(2, noData());
	} else {
		console.log('2222')
	}
}
